package org.flexthinker.binding.form
{
    import org.flexthinker.binding.value.ValueModel;

    /**
     * Sub-interface implemented by form models that allow for configuration of the
     * form's value models, id etc..
     */
    public interface ConfigurableFormModel extends FormModel
    {
        /**
         * An id to identify this form model
         * @param id
         */
        function setId(id:String):void;

        /**
         * Add a valueModel for the given property. Property should be accessible on
         * the formObject.
         * @param propertyName the property to create a valueModel for.
         * @return a <code>ValueModel</code> that wraps this property
         */
        function add(propertyName:String):ValueModel;

        /**
         * Add the given valueModel as wrapper for the given property. Property
         * should be accessible on the formObject. Note that the given valueModel
         * should be used to access the property, but may be wrapped(chained) a
         * number of times in other valueModels.
         * @param propertyName  the name of the property
         * @param valueModel the valueModel to access the property.
         * @return a valueModel that wraps the given valueModel.
         */
        function addValueModelFor( propertyName:String, valueModel:ValueModel):ValueModel;
    }
}